Ext.define('Ext.webapp.resmanage.dictionarylist', {
	extend : 'Ext.grid.Panel',
	id : 'Default',
	title : 'Default',  
	initComponent:function(){
	    var dictionaryform = Ext.create('Ext.webapp.resmanage.dictionaryoperate',{url : BaseMessageI18n.CONSTANT.CONTEXTPATH+'/dictionary/addDictionary.do'});
	    var myData = [];
	    var store = Ext.create('Ext.data.ArrayStore', {
	      fields: [
	                {name: 'company'},
	                {name: 'price', type: 'float'},
	                {name: 'change', type: 'float'},
	                {name: 'pctChange', type: 'float'},
	                {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
	             ],
	             sorters: {
	                 property : 'company',
	                 direction: 'ASC'
	             },
	             data: myData,
	             pageSize: 4
	         });

	         var pagingBar = Ext.createWidget('pagingtoolbar', {
	             store      : store,
	             displayInfo: true,
	             displayMsg : 'Displaying topics {0} - {1} of {2}'
	         });
	         var win;
	         var handleAction = function(action){
	                win = Ext.create('widget.window', {
	                     title: 'Layout Window',
	                     closable: true,
	                     closeAction: 'hide',	           
	                     layout: 'fit',
	                     width: 350,	                  
	                     items: [dictionaryform]
	                 });	
	                win.show();
	         };
	         
	   Ext.apply(this,{
		   store: store,
	       columns: [
	            {header: "Company",      flex: 1, sortable: true, dataIndex: 'company'},
	            {header: "Price",        width: 75,  sortable: true, dataIndex: 'price'},
	            {header: "Change",       width: 75,  sortable: true, dataIndex: 'change'},
	            {header: "% Change",     width: 75,  sortable: true, dataIndex: 'pctChange'},
	            {header: "Last Updated", width: 85,  sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}
	        ],
	        loadMask        : true,

	        viewConfig: {
	            stripeRows: true
	        },

	        bbar: pagingBar,
	        tbar: [
	            {text: BaseMessageI18n.COMMONMENU.ADD,	
	             handler: Ext.Function.pass(handleAction, 'AddDictionary')},'-',
	            {text: BaseMessageI18n.COMMONMENU.UPDATE},'-',
	            {text: BaseMessageI18n.COMMONMENU.DELETE}
	        ]
	   });
	         
	  this.callParent(arguments);
    }
});